<?php 
class GoodsdetailModel extends Model{
	public $table="detail";
//	public $validate=array(
//	 array('category_cid','nonull','请选择所属分类',2,3),
//	  array('brand_bid','nonull','请选择所属品牌',2,3),	
//	  array('gname','nonull','商品名称不能为空',2,3),
//	   array('price','nonull','价格不能为空',2,3),
//	);
	/**
	 * 添加
	 */
	 public function adddetail($gid){
		$photo= isset($_POST['photo']) ? $_POST['photo'] : array();
	 	$_POST['photo']=implode(",",$photo );
	 	$_POST['goods_gid']=$gid;
//		p($_POST);die;

//		p($this->data);die;
		
		return $this->add();
	 }
	 public function edittail($gid){
	    $photo= isset($_POST['photo']) ? $_POST['photo'] : array();
	 	$_POST['photo']=implode(",",$photo);
		$_POST['goods_gid']=$gid;
		
		
//		p($this->data);
		
	 	$this->where("goods_gid={$gid}")->update();
		return true;
	 }
}



 ?>